


public class Comercial extends Muncitor {

  private double ca = -1.0, 
                 fix = -1.0; 
  private static final double procentSalariu = 1.0;

  public Comercial(String nume, double fix, double ca) {
   super(nume);
   this.fix = fix;
   this.ca = ca; 
   }

  
  
  public void setInfoSalar(double fix, double ca) {
	   this.fix = fix;
	   this.ca = ca;
	 }

	  public void setCA(double ca) {
	   if (ca >= 0) { 
		  this.ca = ca;
	   }
	 }

	  public void setFix(double fix) {
	    if (fix >= 0) {
	      this.fix = fix;
	    }
	  }

	  public double getSalar() {
	   if (ca != -1.0 && fix != -1.0) {
	     return fix + (procentSalariu * ca) / 100;
	   }
	   else {
	     return -1.0;
	   }
	 }
	  
  public Comercial(String nume) {
   super(nume);
  }



  public String toString() {
    return super.toString() + ";fix=" + fix + "ca=" + ca;
  }
}